﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;
using System.Collections.ObjectModel;

namespace Delay
{
    public class RegisteAccount : DependencyObject, INotifyPropertyChanged
    {
        private string _nick;

        public string Nick
        {
            get
            {
                return _nick;
            }
            set
            {
                if (_nick != value)
                {

                    _nick = value;
                    NotifyPropertyChanged("Nick");
                }
            }
        }
        private string _headimg;
        public string Headimg
        {
            get
            {
                return _headimg;
            }
            set
            {
                if (_headimg != value)
                {

                    _headimg = value;
                    NotifyPropertyChanged("Headimg");
                }
            }
        }
        private string _userName;

        public string UserName
        {
            get
            {
                return _userName;
            }
            set
            {
                if (_userName != value)
                {
                    _userName = value;
                    NotifyPropertyChanged("UserName");
                }
            }
        }
        private string _passWord;
        
        public string PassWord
        {
            get
            {
                return _passWord;
            }
            set
            {
                if (_passWord != value)
                {
                    _passWord = value;
                    NotifyPropertyChanged("PassWord");
                }
            }
        }
        //userid
        private int _userid;
       
        public int Userid
        {
            get
            {
                return _userid;
            }
            set
            {
                if (_userid != value)
                {
                    _userid = value;
                    NotifyPropertyChanged("Userid");
                }
            }
        }
        //
        private string _lxt;
        
        public string Lxt
        {
            get
            {
                return _lxt;
            }
            set
            {
                if (_lxt != value)
                {
                    _lxt = value;
                    NotifyPropertyChanged("Lxt");
                }
            }
        }
        private string _sex;
        
        public string Sex
        {
            get
            {
                return _sex;
            }
            set
            {
                if (_sex != value)
                {
                    _sex = value;
                    NotifyPropertyChanged("Sex");
                }
            }
        }
        private string _sign;
       
        public string Sign
        {
            get
            {
                return _sign;
            }
            set
            {
                if (_sign != value)
                {
                    _sign = value;
                    NotifyPropertyChanged("Sign");
                }
            }
        }
        private int _viprank;
        
        public int Viprank
        {
            get
            {
                return _viprank;
            }
            set
            {
                if (_viprank != value)
                {
                    _viprank = value;
                    NotifyPropertyChanged("Viprank");
                }
            }
        }
        private string _vipimgurl;
        
        public string Vipimgurl
        {
            get
            {
                return _vipimgurl;
            }
            set
            {
                if (_vipimgurl != value)
                {
                    _vipimgurl = value;
                    NotifyPropertyChanged("Vipimgurl");
                }
            }
        }
        private int _userrank;
      
        public int Userrank
        {
            get
            {
                return _userrank;
            }
            set
            {
                if (_userrank != value)
                {
                    _userrank = value;
                    NotifyPropertyChanged("Userrank");
                }
            }
        }
        //isreg
        private int _isreg;
       
        public int Isreg
        {
            get
            {
                return _isreg;
            }
            set
            {
                if (_isreg != value)
                {
                    _isreg = value;
                    NotifyPropertyChanged("Isreg");
                }
            }
        }
        private int _result;
        public int Result
        {
            get
            {
                return _result;
            }
            set
            {
                if (_result != value)
                {
                    _result = value;
                    NotifyPropertyChanged("Result");
                }
            }
        }
        public string ResultMsg
        {
            get;
            set;
        }
        public int IsLogo
        {
            get;
            set;
        }//
        public string GetPhoneInfoUrl(string account,string password)
        {
            //这个函数不同的类一般要改写
            string url = QueryXml.PhoneRegisterAccountUrl;
            url += ("imei=" + QueryXml.imei);
            url += ("&phonename=" + QueryXml.phonename);
            url += ("&phonevs=" + QueryXml.phonevs);
            url += ("&phonevsno=" + QueryXml.phonevsno);
            url += ("&keyvalue=" + QueryXml.keyvalue);
            url += ("&channelkey=" + QueryXml.channelkey);
            url += ("&account=" + account);
            url += ("&pwd=" + password);
            //
            UserName = account;
            PassWord = password;
            return url;
        }

        //
        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
